#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using Pr=pair<ll,ll>;
#define F(i,l,r) for(ll i=(l);i<=(r);++i)
#define G(i,r,l) for(ll i=(r);i>=(l);--i)
#define pb push_back
#define ct const
#define il inline
#define fi first
#define se second
#define mkr(A,B) make_pair((A),(B))
template<class T>
il void tomn(T&x,T ct&y){if(y<x)x=y;}
template<class T>
il void tomx(T&x,T ct&y){if(x<y)x=y;}
#define dbg(...) fprintf(stderr,__VA_ARGS__)
#define CUT dbg("=========================\n")

ct int N=2.01e7;
ct ll P=998244353;
ll qpow(ll x,ll y){
	ll r=1;
	for(;y;y>>=1,x=x*x%P)if(y&1)r=r*x%P;
	return r;
}
ll inv(ll x){return qpow(x,P-2);}
ll fac[N],faci[N];
il ll C(int n,int m){return 0<=m&&m<=n?fac[n]*faci[n-m]%P*faci[m]%P:0;}
il void add2(ll&x,ll y){x+=y,x-=((-(x>=P))&P);}
il ll add(ll x,ll y){return add2(x,y),x;}
il void sub2(ll&x,ll y){x-=y,x+=((-(x<=0))&P);}
il ll sub(ll x,ll y){return sub2(x,y),x;}

struct Initer{
	Initer(){
		fac[0]=1;
		F(i,1,N-1)fac[i]=fac[i-1]*i%P;
		faci[N-1]=inv(fac[N-1]);
		G(i,N-1,1)faci[i-1]=faci[i]*i%P;
	}
}initer;

int n,m;
ll pw[N];
namespace Sieve{
	int tot,pri[N],d[N];
	void sieve(){
		pw[1]=d[1]=1;
		F(i,2,n){
			if(!d[i])d[i]=i,pw[i]=qpow(i,m),pri[++tot]=i;
			for(int j=1,k;k=pri[j],j<=tot&&k<=d[i]&&k*i<=n;++j)
				d[k*i]=k,pw[k*i]=pw[i]*pw[k]%P;
		}
	}
}
int main(){
	freopen("drama.in","r",stdin);
	freopen("drama.out","w",stdout);
	scanf("%d%d",&n,&m),Sieve::sieve();

	// dbg("pw:	");
	// F(i,0,n)dbg("%lld ",pw[i]);
	// dbg("\n");
	// dbg("f:	");

	ll ans=0,sum=0;
	F(k,0,n){
		sum=(k&1)?sub(sum,faci[k]):add(sum,faci[k]);
		(ans+=sum*pw[n-k]%P*faci[n-k])%=P;

		// wt(sum);
	}

	// dbg("\n");
	
	printf("%lld\n",ans);
}